import { defHttp } from '@/utils/http/axios';
import { AddGraduationMajor, EditGraduationMajor, GraduationMajor, UpdGraduationMajorDisable } from './type';



enum Api {
    getGraduationMajorList = '/admin/custom/major/list',
    addGraduationMajor = '/admin/custom/major/add',
    editGraduationMajor = '/admin/custom/major/update',
    graduationMajorEnable = '/admin/custom/major/disable/set',
    delGraduationMajor = '/admin/custom/major/del'
}

/**
 * @description 查询专业列表
 * @date
 * @export
 * @param
 */
export function getGraduationMajorList(params: any) {
    return defHttp.get<GraduationMajor[]>({
        url: Api.getGraduationMajorList,
        params
    });
}

/**
 * 新增专业
 * @param data 
 * @returns 
 */
export function addGraduationMajor(data: AddGraduationMajor) {
    return defHttp.post({
        url: Api.addGraduationMajor,
        data
    });
}

/**
 * 修改专业
 * @param data 
 * @returns 
 */
export function editGraduationMajor(data: EditGraduationMajor) {
    return defHttp.post({
        url: Api.editGraduationMajor,
        data
    });
}

/**
 * 禁用启用专业
 * @param data 
 * @returns 
 */
export function graduationMajorEnable(data: UpdGraduationMajorDisable) {
    return defHttp.post({ url: `${Api.graduationMajorEnable}`, data });
}

/**
 * 删除毕业专业
 * @param id 
 * @returns 
 */
export function delGraduationMajor(id: number) {
    return defHttp.post({ url: `${Api.delGraduationMajor}/${id}` });
}